<template>
  <div class="div_wrapper">
    <div class="content_wrapper">
      <el-row class="my_row">
        <el-col :span="24">
          <el-form
            :model="setData"
            ref="numberValidateForm"
            label-width="200px"
            class="demo-ruleForm"
          >
            <el-form-item
              label=""
              prop="follows"
              :rules="[{ required: true, message: '不能为空' }]"
            >
              <span slot="label">
              	关注地点
              </span>
              <el-input
                v-model="setData.follows"
                class="w400"
                type="textarea"
  							:rows="4"
                autocomplete="off"
              ></el-input>
            </el-form-item>
            <el-form-item>
                <div class="" style="font-size: 12px;color: #999;">
              		多地点分隔符【逗号(不区分中英文)、顿号】，禁空格分隔
              	</div>
            </el-form-item>
            <el-form-item>
              <el-button
                type="primary"
                @click="submitForm('numberValidateForm')"
                >保存</el-button
              >
              <!-- <el-button @click="resetForm('numberValidateForm')"
                >重置</el-button
              > -->
            </el-form-item>
          </el-form>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
import Vue from "vue";

export default {
  name: "settime",
  data() {
    return {
      setData: {
//      id: "",
//      imgname: "",
//      leavelimit: "",
//      removelimit: "",
        follows: "",
//      deptid: '',
      },
    };
  },

  created() {
    this.GetData();
  },
  methods: {
    //
    GetData() {
      let that = this;
      that.postAxios("/SysSetting/GetDeptFollows", null).then((res) => {
        if (res.code == 0) {
          that.setData.follows = res.data;
        }
      });
    },
    submitForm(formName) {
      let that = this;
      this.$refs[formName].validate((valid) => {
        if (valid) {
          that
            .postAxios("/SysSetting/EditDeptFollows", that.setData)
            .then((res) => {
              if (res.code == 0) {
                that.$notify({
                  title: "成功",
                  message: "操作成功",
                  type: "success",
                });
                that.GetData();
              } else {
                that.$notify.error({
                  title: "错误",
                  message: "操作失败",
                });
              }
            });
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
    resetForm(formName) {
      this.$refs[formName].resetFields();
    },
  },
};
</script>

<style scoped lang="scss">
.w400 {
  width: 400px;
}

.font_bold {
  font-weight: bold;
  font-size: 16px;
}

.div_wrapper {
  height: 100%;
  width: 100%;
  background: #fff;
}

.content_wrapper {
  padding-top: 40px;
  .my_row {
    padding-top: 40px;
  }
}
</style>